package com.central.comment.service

import com.baomidou.mybatisplus.extension.plugins.pagination.Page
import com.central.comment.pojo.comment.CommentDto
import com.central.common.entity.Comment
import com.central.common.enum.CommentTypeEnum
import com.central.common.model.*
import com.central.common.service.ISuperService

/**
 * @author  fly
 * @date  2021/5/28 15:07
 * @version 1.0
 */
interface CommentService : ISuperService<Comment> {


    /**
     * 添加评论
     */
    fun insertComment(commentDto: CommentDto, sysUser: SysUser): CommonResult<Boolean>

    /**
     * (rpc) 添加评论
     */
    fun insertComment(commentRpcDto: CommentRpcDto): Comment?

    /**
     * 移除评论
     */
    fun removeComment(ids: String): CommonResult<Boolean>

    /**
     * 获取某个类型的全部评论信息
     */
    fun getCommentVoListByRelevanceId(relevanceId: Long, sysUser: SysUser, pageVo: PageVo, commentTypeEnum: CommentTypeEnum): Page<CommentVo>?

    /**
     * 获取某个类型的全部评论数量
     */
    fun getCommentNumByRelevanceId(relevanceId: Long, commentTypeEnum: CommentTypeEnum): Long

    /**
     * 获取某个人在某个类型的全部评论信息
     */
    fun getCommentVoListByUserId(userId: Long, commentTypeEnum: CommentTypeEnum): List<Comment>?

    /**
     * 获取某个类型的全部评论人
     */
    fun getCommentAllUserIds(commentTypeEnum: CommentTypeEnum, pageVo: PageVo): Page<Long>?

    /**
     * 根据内容评论人评论类型获取评论数据
     */
    fun getCommentByContentAndUserIdAndTypeAndRelevanceId(content: String, userId: Long, commentTypeEnum: CommentTypeEnum, relevanceId: Long): Comment?
}
